<?php 
ob_start();
include("include/connect.php");
include("admin/libraries/database.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Robots" content="index,follow">

<LINK REL="SHORTCUT ICON" HREF="img/stock-photo-cinema-blue-glossy-square-web-icon-isolated-123442132-20130425-favicon.ico">
<title>Untitled Document</title>
<link href="style/css.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="style/jquery.dimensions.js"></script>
<script type="text/javascript" src="style/jquery.js"></script>
<script type="text/javascript" src="style/jquery.lazyloader.min.js"></script>
<script type="text/javascript" src="style/jquery.tooltip.js"></script>
<!--<script type="text/javascript" src="style/jquery.rating.js"></script>-->
<script type="text/javascript" src="style/phimsot.js"></script>
<script type="text/javascript" src="style/contact.js"></script>

</head>

<body>
<?php 
$sql="select * from theme where ten='quangcao'";$query=mysql_query($sql);while($row=mysql_fetch_assoc($query)){$data[]=$row;}
$theme=mysql_query("select * from theme");
while ($temp = mysql_fetch_array($theme))
{
	echo '<div id="'.$temp["ten"].'" style="display:none" title="'.$temp["duongdan"].'">'.$temp["giatri"].'
</div>';
}
?>
<div id="ad_col_left" style="display:block">
    <a target="_blank" href="http://vietliveradio.com/">
    	<img alt="" src="img/120_600_1.jpg">
    </a>
</div>
<div id="ad_col_right" style="display:block">
    <a target="_blank" href="http://vienlien247.com/">
    	<img alt="" src="img/120 600.jpg">
    </a>
</div>
    <div id="header">
    	<div class="wrapper">
            <a href="index.php" id="body_logo" title="Trang chủ"><img src="" style="width:140px;height:40px" /></a>
            <div class="menu">
                <?php include("include/menu.php"); ?>
            </div><!-- end of menu -->
        </div><!-- end of wrapper -->
    </div><!-- end of header -->
    <div id="top_film" class="wrapper">
    	<?php include("include/top_film.php")?>
    </div><!-- end of topfilm -->
	<div id="main" class="wrapper">
    	<div class="col1">
        	<?php 
				if(isset($_GET['key']))
				{
					switch($_GET['key']) 
					{
					case "default":include("include/film_list.php");break;
					case "detail":include("include/detail.php");break;
					
					case "new":include("include/film_list.php");break;
					case "request":include("include/film_list.php");break;
					case "year":include("include/film_list.php");break;
					case "act":include("include/film_list.php");break;
					case "dir":include("include/film_list.php");break;
					case "prod":include("include/film_list.php");break;
					case "mostviewed":include("include/film_list.php");break;
					
					case "contact";include("include/contact.php");break;
					case "req";include("include/request.php");break;
					case "watch":include("include/watch.php");include("include/film_list.php");break;	
					case "sub":echo "<h1 class='ps_title'>Nhận email mỗi ngày</h1><div class='clear'></div><div class='ps_padding_10'>Cám ơn , bạn sẽ nhận đựoc email của chúng tôi </div>";break;
					case "sub_failed":echo "<h1 class='ps_title'>có lỗi xảy ra ...</h1><div class='clear'></div><div class='ps_padding_10'>Email có ngừoi sử dụng</div>";break;
					case "form":echo "<h1 class='ps_title'>Xin cám ơn</h1><div class='clear'></div><div class='ps_padding_10'>Bạn sẽ nhận đựoc email phản hồi trong thời gian sớm nhất </div>";break;
					case "form_failed":echo "<h1 class='ps_title'>có lỗi xảy ra ...</h1><div class='clear'></div><div class='ps_padding_10'>Thông tin này có ngừoi sử dụng</div>";break;
					default:include("include/film_list.php");break;
					}
				}
				else include("include/film_list.php");
			?>
        	<?php ?>
        </div><!-- end of col 1 -->

        <div class="col2">
        	<div class="subscribe">
				<h2>Nhận phim mới qua Email</h2>
				<form id="email_subscribe_form" name="email_subscribe_form" method="post" action="include/subscribe_process.php">
                <input type="text" name="email_subscribe" value="Email của bạn...">
                <button type="submit"></button>
                </form>
			</div>
            <div class="search">
            	<?php include("include/search.php")?>
        	</div><!-- subcribe and search -->
            
            <?php include("include/boxes.php")?>
        </div><!-- end of col 2 -->
        <div class="clear"></div>
        <br /><br />
        
        <div id="ps_footer_link">
        	<?php include("include/footer_link.php") ?>
		</div><!-- end of footer_link -->
        
    </div><!-- end of main -->
    <div id="footer" class="wrapper">
        <?php include("include/footer.php")?>
    </div><!-- end of footer -->
    </body>
<script type="text/javascript">
//ajax
$.ajaxSetup ({  
        cache: false  
    });  
var ajax_load = "<img src='img/load.gif' alt='loading...' />";  
$(".no_title").hover(
	function(){
		$(this).css("text-decoration", "underline"); 
	},function(){
		$(this).css("text-decoration", "none"); 
	}
)
$(".poster").hover(
	function(){
		$(this).css("border","3px solid black");
	},function(){
		$(this).css("border","");
	}
)
$('.maloai').hover(
	function(){
		$(this).css('cursor','default');
	},
	function(){
		
	}
)
$(".dock").hover(
	function(){
		$("div :first-child", $(this)) .css("box-shadow","10px 10px 10px black");
		
	},function(){
		$("div :first-child", $(this)).css("box-shadow","");
	}
)
var title = $('.col1 > .ps_title').text();
$('title').text(title);
$("img").error(function() {
    $(this).attr("src", "img/thumbnail_default.gif");
});
var bg=$('#hinhnen').attr('title');
var tieude=$('#mau_tieude').text();
var logo=$('#logo').attr('title');
var thongtin=$('#thongtin').text();
var tensite = $('#tenwebsite').text();
$('.ps_title').css('background-color',tieude);
$('body').css("background-image", "url("+bg+")");
$('#body_logo img').attr("src",logo);
$('#body_thongtin').text(thongtin);
$('.body_tensite').text(tensite);
//rating

$('.star-rating-control > div').hover(function(){
	$(this).removeClass('star-rating-on');
	$(this).prevAll().addClass('star-rating-hover');
	$(this).addClass('star-rating-hover');
},function(){
	$(this).prevAll().removeClass('star-rating-hover');
	$(this).removeClass('star-rating-hover');
})
$('.star-rating-control > div').click(function(){
	$(this).prevAll().addClass('star-rating-hover');
	$(this).addClass('star-rating-hover');
	var rating=$(this).find('a').text();
	var id=$('#loader').attr('alt');
	loadUrl="include/rating.php";
	$.post(loadUrl,{star: rating,maphim:id},function(responseText){
		$('.star-rating-control > div').unbind();
		$('#star_text').text(responseText);
		},"html");  
	});
$('.film_share').click(function(e){
	$('#x').remove();
	$('#film_share').css('display','block');
	$('<tr><td colspan = "2"><span id = "x" style="display:block;float:right;cursor:pointer">X</span></td></tr>').prependTo($('#film_share tbody'));
	$('#x').click(function(e){$('#film_share').css('display','none');$('#x').remove()});
	});
$('.film_info').click(function(e){
	$('#x').remove();
	$('#film_info').css('display','block');
	$('<span id = "x" style="display:block;float:right;cursor:pointer;clear:both">X</span>').prependTo($('#film_info'));
	$('#x').click(function(e){$('#film_info').css('display','none');$('#x').remove()});
	});
$('#ps_episodereport').click(function(e){
	alert('Chúng tôi đã nhận đựoc báo lỗi , cám ơn bạn !');
	});
var description=$('#seo_description').text();
var keywords=$('#seo_keywords').text();
var domain = document.location.hostname.replace(/\./g," ");
$('<meta name="description" content="'+domain+description+'">').appendTo('head');
$('<meta name="keywords" content="'+domain+keywords+'">').appendTo('head');
</script>
</html>
